<template>
	<view class="page">
		<view class="user-box">
			<view class="head-out">
				<view class="user-head">
					<view class="left-out">
						<image :src="userInfo.icon" class="head-img" mode=""></image>
					</view>
					<view class="head-center">
						<view class="head-name">
							{{userInfo.nickname}}
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<view class="order-out">
			<view class="item-box">
				<view class="box-item">
					<view class="item-in">
						<view class="item-left">
							<view class="item-title">个人信息</view>
						</view>
						<view class="item-right" @tap="modifyInfo">
							<view class="right-icon iconfont icon-arr-right"></view>
						</view>
					</view>
				</view>
				<view class="box-item">
					<view class="item-in">
						<view class="item-left">
							<view class="item-title">修改密码</view>
						</view>
						<view class="item-right">
							<view class="right-icon iconfont icon-arr-right"></view>
						</view>
					</view>
				</view>
				<view class="box-item">
					<view class="item-in">
						<view class="item-left">
							<view class="item-title">修改手机</view>
						</view>
						<view class="item-right">
							<view class="">{{userInfo.phone.substr(0,3)}}****{{userInfo.phone.substr(7,12)}}</view>
							<view class="right-icon iconfont icon-arr-right" @tap="modifyPhone"></view>
						</view>
					</view>
				</view>
				<view class="box-item">
					<view class="item-in">
						<view class="item-left">
							<view class="item-title">我的会员</view>
						</view>
						<view class="item-right">
							<view class="">普通会员</view>
							<view class="right-icon iconfont icon-arr-right" @tap="toMember"></view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {}
			}
		},
		onShow() {
			this.userInfo = this.getGlobalUser("globalUser");
		},
		methods: {
			modifyInfo(){
				uni.navigateTo({
					url: '../person/person'
				})
			},
			modifyPhone(){
				uni.navigateTo({
					url: '../modifyPhone/modifyPhone'
				})
			},
			toMember(){
				uni.navigateTo({
					url: '../member/member'
				})
			}
		}
	}
</script>

<style>
	@import url("userinfo.css");
	@import url("../../../static/iconfont/iconfont.css");
</style>
